//
//  ViewController.m
//  涂鸦多条线
//
//  Created by xalo on 16/6/27.
//  Copyright © 2016年 xalo. All rights reserved.
//

#import "ViewController.h"
#import "LTPointView.h"
#import "UIImage+CZ.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet LTPointView *pointView;

@end

@implementation ViewController

//回撤
- (IBAction)backAciton:(id)sender {
    
    [self.pointView back];
}

//清空数组里的线
- (IBAction)clearAction:(id)sender {
    
    [self.pointView clear];
}

//保存图片到桌面
- (IBAction)saveAction:(id)sender {
    
    UIImage *captureImage = [UIImage captureImage:self.pointView];
    
    NSData *imageData = UIImagePNGRepresentation(captureImage);
    
    [imageData writeToFile:@"/Users/xalo/Desktop/pic/capture.png" atomically:YES];
}
- (IBAction)colorAction:(UIButton *)sender {
    
    self.pointView.color = sender.backgroundColor;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}

@end
